﻿using System;
using System.Configuration;
using System.Web;

namespace MediaBrowserSL.BLL.Contexts
{
    public class PathMediaContext
    {
        public static String GenericPathMedia
        {
            get
            {
                if (HttpContext.Current != null)
                {
                    return UrlPathMedia;
                }
                else
                {
                    return DirPathMedia;
                }
            }
        }

        public static String UrlPathMedia
        {
            get
            {
                return ConfigurationManager.AppSettings["UrlPathMedia"];
            }
        }

        public static String DirPathMedia
        {
            get
            {
                string folderMedia = ConfigurationManager.AppSettings["DirPathMedia"];
                return HttpContext.Current.Server.MapPath("~/" + folderMedia + "/");
            }
        }
    }
}
